var vm = new Vue({
    el: "#app",

    data: {  //用来定义数据
        searchText: '', //保存输入框输入的内容（临时）


        currentIndex: 0,
        currentIndex2: 0,

        list: [
            { pic: '', name: '首页' },
            { pic: '', name: '订单' },
            { pic: '', name: '我的' },
        ],

        arr: [
            { pic: '', name: '综合推荐' },
            { pic: '', name: '综合推荐' },
            { pic: '', name: '距离最近' },
            { pic: '', name: '销量最高' },
            { pic: '', name: '筛选' },
        ],

        arr2: [
            { pic: "pic.png", title1: '金百万烤鸭（苏家坨店）', num: 1256, cond: 3.5 },
            { pic: "pic.png", title1: '稻香金源饺子馆', num: 1253, cond: 4.2 },
        ],
    },
   


    methods: { //用来定义方法（函数）
        search() {
            if (this.searchText) {
                //将输入框中输入的内容保存到searchArr
                this.searchArr.push(this.searchText)
                //清空输入框
                this.searchText = ''
            }
        },
        handleClick(index) {
            this.currentIndex = index;//保存点击的按钮下标
        },
        handleClick2(index) {
            this.currentIndex2 = index;//保存点击的按钮下标
        }
    }

})